import { sequelize } from "../db/sequelize.js"
import { DataTypes } from "sequelize"

//创建数据库用户模型并导出
export const User = sequelize.define('users', {
  id: {
    type: DataTypes.INTEGER,
    primaryKey: true,
    autoIncrement: true
  },
  //用户名
  userName: {
    type: DataTypes.STRING
  },
  //密码
  password: {
    type: DataTypes.STRING
  },
  userImg: {
    type: DataTypes.STRING
  },
  member: {
    type: DataTypes.INTEGER
  },
})

//导出同步数据库方法
export const usersync = function () {
  sequelize.sync()
}

